package com.spikything.gfx {
	
	import flash.display.Sprite;

	public class RoundFrame extends Sprite {
		
		private var _width 	:Number;
		private var _height :Number;
		private var bgcolor :Number;
		private var bgalpha	:Number;
		private var round 	:Number;
		
		public function RoundFrame (width:Number = 0, height:Number = 0, bgcolor:Number = 0, bgalpha:Number = 1, round:Number = 0) {
			_width = width;
			_height = height;
			this.bgcolor = bgcolor;
			this.bgalpha = bgalpha;
			this.round = round;
			this.width = width;
			this.height = height;
		}
		
		override public function set width (value:Number):void {
			var myHeight:Number = height;
			_width = value;
			graphics.clear();
			graphics.beginFill(bgcolor, bgalpha);
			graphics.drawRoundRect(0, 0, value, myHeight, round, round);
		}
		
		override public function set height (value:Number):void {
			var myWidth:Number = width;
			_height = value;
			graphics.clear();
			graphics.beginFill(bgcolor, bgalpha);
			graphics.drawRoundRect(0, 0, myWidth, value, round, round);
		}
	
	}

}